var siteinfo = require('../siteinfo.js'); 
function getUrlParam(e, t) {
    var n = new RegExp("(^|&)" + t + "=([^&]*)(&|$)"), r = e.split("?")[1];
    return null != r ? unescape(r[2]) : null;
}
function getQuery(e) {
    var t = [];
    if (-1 != e.indexOf("?")) for (var n = e.split("?")[1].split("&"), r = 0; r < n.length; r++) n[r].split("=")[0] && unescape(n[r].split("=")[1]) && (t[r] = {
        name: n[r].split("=")[0],
        value: unescape(n[r].split("=")[1])
    });
    return t;
}
function getLogin() {  
    var token = uni.getStorageSync('token');
    return !!token;
}  
function getSign(e, t, n) {
    var r = require("./underscore.js"), a = require("./md5.js"), i = "", o = getUrlParam(e, "sign");
    if (o || t && t.sign) return !1;
    if (e && (i = getQuery(e)), t) {
        var s = [];
        for (var u in t) u && t[u] && (s = s.concat({
            name: u,
            value: t[u]
        }));
        i = i.concat(s);
    }
    i = r.sortBy(i, "name"), i = r.uniq(i, !0, "name");
    for (var c = "", f = 0; f < i.length; f++) i[f] && i[f].name && i[f].value && (c += i[f].name + "=" + i[f].value, 
    f < i.length - 1 && (c += "&"));
    return o = a(c + (n = n || siteinfo.token));
}
function getUrl(str) {  
    return siteinfo.siteroot + str +'?uniacid=' + siteinfo.uniacid//这里没写逻辑  
}  																																												//panda_key _custom
module.exports = {  
	getSign:getSign,
	getLogin:getLogin,
	getUrlParam:getUrlParam,
	getUrl:getUrl
} 